checkUpdate();

function checkUpdate() {
    var ver = 101;
    toast("正在检查更新...");
    var url = "https://gitee.com/wdsjimin/tcx/raw/master/releases.json"
    var GET = http.get(url);
    log(GET);
    if (GET.statusCode == 200) {
        var json = GET.body.json()[0]
        if (json.ver > ver) {
            alert("检测到新版本: \n版本" + json.ver + ",当前版本" + ver + "\n 更新内容: \n" + json.text + "\n源码地址: \n" + json.kaiyuan);
            app.openUrl(json.download)
        } else {
            toastLog("没有更新");
        }
    } else {
        toast("检查更新失败，请检查网络。");
    }
}